{% extends "WbiSocialBundle::layout.html.twig" %}

{% block wbiblog_body %}
<article>
<h1>Liste des articles</h1>

<table class="records_list">
   

    <tbody>

    {% for entity in entities %}


            <tr>
                <th>Utilisateur: {{ entity.users.usernicename }}</th>
            </tr>

         <tr>
            <th>Sujet: <a href="{{ path('posts_show', { 'id': entity.id }) }}">{{ entity.postTitle }}</a></th>
            <tr>
            </tr>
        </tr>
        <tr>
           
            <tr>
            <td class="content_body" >{{ entity.postContent }}</td>
            </tr>
            <tr>
            <td class="span">{% if entity.postDate %}{{ entity.postDate|date('Y-m-d H:i:s') }}{% endif %}</td>
            </tr>
       </tr>
         
      
        <tr>
         
         {% for comment in entity.comments %}
                 <tr>
                
                  <tr>
                  <td>{{ comment.users.userNicename }}</td>
                  </tr>
           
                 </tr>
                 <tr>
                 <td class="content_comment">{{ comment.commentcontent }}</td>
                 </tr>
                   <tr>
                 <td class="span">{% if comment.commentDate %}{{ comment.commentDate|date('Y-m-d H:i:s') }}{% endif %}</td>
                 </tr>
            </tr>
         {% endfor %}
      </tr>
   

            <tr>
            <th><a href="{{ path('comments_new', { 'userid': entity.users.id }, { 'postId': entity.id }) }}">ajouter un commentaire</a></th>
            </tr>
          </tr>
    <tr>
      <td> <hr class="sepa-home"> </td>
    </tr>
    {% endfor %}

    </tbody>

</table>

<ul>
    <li>
        <a href="{{ path('posts_new') }}">
            Creer un nouveau article
        </a>
    </li>
</ul>
 </article>
 

 {% endblock %}


           
